import { defineConfig } from 'umi';

export default defineConfig({
  proxy: {
    '/api': {
      target: 'http://localhost:8080',
      changeOrigin: true,
      pathRewrite: { '^/api': '' },
    },
  },
  antd: {},
  model: {},
  layout: {
    title: 'OP 判题平台',
    locale: false,
  },
  routes: [
    {
      path: '/',
      name: '题库',
      icon: 'BookOutlined',
      component: './Home',
    },
    {
      path: '/problem/:id',
      name: '题目详情',
      hideInMenu: true,
      component: './Problem/[id]',
    },
    {
      path: '/submissions',
      name: '我的提交',
      icon: 'ProfileOutlined',
      component: './Submissions',
    },
    {
      path: '/result/:id',
      name: '评测结果',
      hideInMenu: true,
      component: './Result/[id]',
    },
    {
      path: '*',
      component: './404',
    },
  ],
  npmClient: 'pnpm',
});